<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">
    <ui:define name="head">
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
        </script>
        <style type="text/css">
            .c_c {
                background: gray;
            }
        </style>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px;">
            <h:form id="form">
                <p:growl id="msgs" showDetail="false"/>
                <p:panel id="inputItemHieRelap" header="总包合同数量_统计录入" style="width: 100%">
                    <h:panelGrid columns="2" style="width: 100%">
                        <h:panelGrid id="pgItemHieRelapInput" widgetVar="wvItemHieRelap"
                                     columns="10" style="width: 100%" >

                            <h:outputLabel for="noItemHieRelap" value="编号:" />
                            <h:inputText id="noItemHieRelap"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_StrNo}"
                                         style="font-weight:bold;background-color:gainsboro"
                                         disabled="true">
                            </h:inputText>

                            <h:outputLabel for="name" value="名称:" />
                            <h:inputText id="name" value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Name}"
                                         style="font-weight:bold;background-color:gainsboro"
                                         disabled="true"/>

                            <h:outputLabel for="note" value="备注内容:" />
                            <h:inputTextarea id="note" value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Note}"
                                               rows="1" autoResize="false"
                                               style="font-weight:bold;background-color:gainsboro"
                                               disabled="true"/>

                            <h:outputLabel for="unitItemInfo" value="单位:"/>
                            <h:inputText id="unitItemInfo"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Unit}"
                                         style="font-weight:bold;background-color:gainsboro"
                                         disabled="true"/>

                            <h:outputLabel for="contractUnitPriceItemInfo" value="合同单价:"/>
                            <h:inputText id="contractUnitPriceItemInfo"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_ContractUnitPrice}"
                                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                                         disabled="true">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:inputText>

                            <h:outputLabel for="contractQuantityItemInfo" value="合同数量:"/>
                            <h:inputText id="contractQuantityItemInfo"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_ContractQuantity}"
                                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                                         disabled="true">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:inputText>

                            <h:outputLabel for="eng_BeginToCurrentPeriodEQty" value="开累工程数量:"/>
                            <h:inputText id="eng_BeginToCurrentPeriodEQty"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.eng_BeginToCurrentPeriodEQty}"
                                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                                         disabled="true">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:inputText>

                           <h:outputLabel for="eng_CurrentPeriodEQty" value="本期工程数量:"/>
                            <h:inputText id="eng_CurrentPeriodEQty"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.eng_CurrentPeriodEQty}"
                                         style="font-weight:bold;text-align:right;float:left">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                                <p:ajax event="blur" update="msgs,eng_BeginToCurrentPeriodEQty"
                                        listener="#{itemHieRelapStlEngStaAction.blurEng_CurrentPeriodEQty('blur')}"/>
                            </h:inputText>

                            <h:outputLabel for="signPartAPriceItemInfo" value="其中：甲供材单价:" rendered="false"/>
                            <h:inputText id="signPartAPriceItemInfo"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_SignPartAPrice}"
                                         style="font-weight:bold;background-color:gainsboro"
                                         rendered="false">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:inputText>

                        </h:panelGrid>
                        <h:panelGrid id="pgItemHieRelapBtn" columns="2"  style="width:100%">
                            <p:commandButton id="submitBtn" value="提交"
                                             action="#{itemHieRelapStlEngStaAction.submitThisRecordAction}"
                                             style="width:60px"
                                             update="pgItemHieRelapInput,ptt,msgs,pgInputBlur,pgItemHieRelapBtn"
                                             rendered="#{itemHieRelapStlEngStaAction.submitBtnRendered}">
                                <!--icon="ui-icon-disk"-->
                            </p:commandButton>
                            <p:commandButton id="resetBtn" value="重置"
                                             action="#{itemHieRelapStlEngStaAction.reSetAction}"
                                             style="width:60px"
                                             update="inputItemHieRelap,pcm"
                                             rendered="#{itemHieRelapStlEngStaAction.submitBtnRendered}">
                            </p:commandButton>
                        </h:panelGrid>
                        <h:panelGrid id="pgInputBlur" columns="8" rendered="false">
                            <h:outputLabel for="pkidItemHieRelap" value="Pkid:" />
                            <h:inputTextarea id="pkidItemHieRelap"
                                             value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Pkid}"
                                             style="font-weight:bold;width:200px"
                                             disabled="true"/>
                            <h:outputLabel for="parentPkidItemHieRelap" value="父层Pkid:" />
                            <h:inputTextarea id="parentPkidItemHieRelap"
                                             value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_ParentPkid}"
                                             style="font-weight:bold;width:200px"
                                             disabled="true"/>
                            <h:outputLabel for="itemPkidItemHieRelap" value="项Pkid:" />
                            <h:inputTextarea id="itemPkidItemHieRelap"
                                             value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_ItemPkid}"
                                             style="font-weight:bold;width:200px"
                                             disabled="true"/>
                            <h:outputLabel for="correspondingPkidItemHieRelap" value="对应Pkid:" />
                            <h:inputTextarea id="correspondingPkidItemHieRelap"
                                             value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_CorrespondingPkid}"
                                             style="font-weight:bold;width:200px"
                                             disabled="true"/>
                            <h:outputLabel for="gradeItemHieRelap" value="层号:" />
                            <h:inputText id="gradeItemHieRelap"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Grade}"
                                         style="font-weight:bold"
                                         disabled="true"/>
                            <h:outputLabel for="orderidItemHieRelap" value="序号:" />
                            <h:inputText id="orderidItemHieRelap"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Orderid}"
                                         style="font-weight:bold"
                                         disabled="true"/>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:contextMenu for="ptt" id="pcm">
                    <!--process="pgItemHieRelapInput,@this"执行范围-->
                    <p:menuitem value="更新" icon="ui-icon-arrowrefresh-1-w"
                                actionListener="#{itemHieRelapStlEngStaAction.selectRecordAction('upd')}"
                                update="inputItemHieRelap,msgs,ptt,pgItemHieRelapBtn">
                    </p:menuitem>
                    <p:menuitem value="删除" icon="ui-icon-close"
                                actionListener="#{itemHieRelapStlEngStaAction.selectRecordAction('del')}"
                                update="inputItemHieRelap,msgs,ptt,pgItemHieRelapBtn">
                    </p:menuitem>
                </p:contextMenu>
                <p:dataTable id="ptt" style="width:100%;"
                             value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstructList}"
                             var="record"
                             rowKey="#{record.tkctt_Pkid}"
                             selection="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstructSelected}"
                             selectionMode="single"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink}
                                            {LastPageLink} {RowsPerPageDropdown}"
                             paginator="true"
                             paginatorPosition="bottom"
                             rows="20"
                             rowsPerPageTemplate="200,100,50,40,30,20,10"
                             rowIndexVar="row"
                             emptyMessage="数据记录为空..."
                             widgetVar="dtItemDetail"
                             rowStyleClass="#{record.tkctt_Unit eq null? 'c_c':null}"
                             scrollable="true"
                             scrollHeight="481">
                    <!--rowStyleClass="#{record.tkctt_ContractQuantity eq null? 'c_c':null}"-->
                <p:column headerText="序号" style="width:30px">
                    <h:outputText value="#{row + 1}"/>
                </p:column>

                <p:column style="width:100px" headerText="编号">
                    <h:outputText value="#{record.tkctt_StrNo}" escape="false"/>
                </p:column>

                <p:column style="width:200px" headerText="名称">
                    <h:outputText value="#{record.tkctt_Name}" />
                </p:column>

                <p:column style="width:30px" headerText="单位">
                    <h:outputText value="#{record.tkctt_Unit}" style="text-align:right"/>
                </p:column>

                <p:column style="width:80px" headerText="合同单价">
                    <h:outputText value="#{record.tkctt_ContractUnitPrice}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>

                <p:column style="width:80px" headerText="合同数量">
                    <h:outputText value="#{record.tkctt_ContractQuantity}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>

                <p:column style="width:80px" headerText="合同金额">
                    <h:outputText value="#{record.tkctt_ContractAmount}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>

                <p:column headerText="开累工程数量">
                    <h:outputText value="#{record.eng_BeginToCurrentPeriodEQty}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>

                <p:column headerText="开累工程金额">
                    <h:outputText value="#{record.eng_BeginToCurrentPeriodEAmount}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>

                <p:column headerText="当期工程数量">
                    <h:outputText value="#{record.eng_CurrentPeriodEQty}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>

                <p:column headerText="当期工程金额">
                    <h:outputText value="#{record.eng_CurrentPeriodEAmount}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>

                <f:facet name="footer">
                    <div style="text-align: left">
                        <p:commandButton id="mngFinishBtn" value="录入结束"
                                         style="width:90px"
                                         action="#{itemHieRelapStlEngStaAction.mngFinish_SetInitToStatusFlagAction('6')}"
                                         update=":form:msgs"
                                         rendered="#{itemHieRelapStlEngStaAction.strIsNullAndInitRendered}"/>
                        <p:commandButton id="mngNotFinishBtn" value="重新录入"
                                         style="width:90px"
                                         action="#{itemHieRelapStlEngStaAction.mngNotFinishAction('6')}"
                                         update=":form:msgs"
                                         rendered="#{itemHieRelapStlEngStaAction.strIsNullAndInitRendered}"/>
                    </div>
                </f:facet>
            </p:dataTable>
            </h:form>
        </div>
    </ui:define>
</ui:composition>